From 6d48a6f031f347fb28eb588b1e1264f0116a4c1a Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 17 Jul 2003 23:25:46 +0000 Subject: [PATCH] Add 'arc' style and xcsv support for tracks and routes --- gpsbabel/csv_util.c | 19 ++++++++++++++++++- gpsbabel/style/arc.style | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gpsbabel/style/arc.style diff --git a/gpsbabel/csv_util.c b/gpsbabel/csv_util.c index 9d3c7701a..c6014dc73 100644 --- a/gpsbabel/csv_util.c +++ b/gpsbabel/csv_util.c @@ -795,6 +795,12 @@ xcsv_waypt_pr(const waypoint *wpt) index++; } +static void +xcsv_noop(const route_head *wp) +{ + /* no-op */ +} + /*****************************************************************************/ /* xcsv_data_write(void) - write prologues, spawn the output loop, and write */ /* epilogues. */ @@ -810,7 +816,18 @@ xcsv_data_write(void) ogp = (ogue_t *) elem; fprintf (xcsv_file.xcsvfp, "%s%s", ogp->val, xcsv_file.record_delimiter); } - waypt_disp_all(xcsv_waypt_pr); + + switch (global_opts.objective ) { + case wptdata: + waypt_disp_all(xcsv_waypt_pr); + break; + case rtedata: + case trkdata: + route_disp_all(xcsv_noop,xcsv_noop,xcsv_waypt_pr); + break; + default: + break; + } /* output epilogue lines, if any. */ QUEUE_FOR_EACH(&xcsv_file.epilogue, elem, tmp) { diff --git a/gpsbabel/style/arc.style b/gpsbabel/style/arc.style new file mode 100644 index 000000000..82fcbc9bc --- /dev/null +++ b/gpsbabel/style/arc.style @@ -0,0 +1,21 @@ +# gpsbabel XCSV style file +# +# Format: GPSBabel arc filter format +# Author: Ron Parker +# Date: 17 July 2003 +# + +DESCRIPTION GPSBabel arc filter file +EXTENSION txt + +# +# FILE LAYOUT DEFINITIIONS: +# +FIELD_DELIMITER TAB +RECORD_DELIMITER NEWLINE + +# +# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: +# +IFIELD LAT_DECIMAL, "", "%08.5f" +IFIELD LON_DECIMAL, "", "%08.5f" -- 2.30.2